import pymysql
import time

#测试数据库语句

conn = pymysql.connect(host='192.168.187.130',user='root',passwd='123456',db='homework')
cur = conn.cursor()
mask = 9999
name = "测试语句3"

#cur.execute("insert into project(mask,name,date,time,uprize,downprize,midprize,bigtype,smalltype,averageprofit) values(9999,'测试语句','2021-2-13',40,5000,3000,4000,null,null,100);")
cur.execute("insert into project(mask,name) values(10001,'测试语句4');")
#sql = """select * from project;"""
#cur.execute(sql)
#sql = """ insert into project(mask,name,date,time,uprize,downprize,midprize,bigtype,smalltype,averageprofit) values(9999,'测试语句','2021-2-13',40,5000,3000,4000,null,null,100)"""

'''
sql = "INSERT INTO EMPLOYEE(FIRST_NAME, \
       LAST_NAME, AGE, SEX, INCOME) \
       VALUES (%s, %s, %s, %s, %s )" % \
       ('Mac', 'Mohan', 20, 'M', 2000)
sql = "INSERT INTO project(MASK, NAME) \
       VALUES (%d, %s)" % \
       (9999, '测试语句3')
cur.execute(sql)
'''

#cur.execute(sql)
results = cur.fetchone()
#for row in results:
#    print(str(row))

print(results)

cur.close()

conn.close()